home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 December / PCWorld_2007-12_cd.bin / v cisle / fma / fma-2.1-beta-4-setup.exe / {app} / help / script56.chm / local / splitscreen.js < prev    next >
Text File  |  2005-12-12  |  892b  |  25 lines

  1.  
  2.     function SplitScreen (nonScrollingRegionId, scrollingRegionId) {
  3.  
  4.         // store references to the two regions
  5.         this.nonScrollingRegion = document.getElementById(nonScrollingRegionId);
  6.         this.scrollingRegion = document.getElementById(scrollingRegionId);
  7.  
  8.         // set the scrolling settings
  9.         document.body.style.margin = "0px";
  10.         document.body.style.overflow = "hidden";
  11.         this.scrollingRegion.style.overflow = "auto";
  12.  
  13.         // fix the size of the scrolling region
  14.         this.resize(null);
  15.  
  16.         // add an event handler to resize the scrolling region when the window is resized        
  17.         registerEventHandler(window, 'resize', getInstanceDelegate(this, "resize"));
  18.  
  19.     }
  20.  
  21.     SplitScreen.prototype.resize = function(e) {
  22.         this.scrollingRegion.style.height = document.body.clientHeight - this.nonScrollingRegion.offsetHeight;
  23.         this.scrollingRegion.style.width = document.body.clientWidth;
  24.     }
  25.